package com.zhao.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ILogMapper {
    /**
     * 查询指定用户日志信息
     *
     * @return
     */
    @Results(id = "logResultMap", value = {
            @Result(id = true, property = "id", column = "l_id"),
            @Result(property = "type", column = "l_type"),
            @Result(property = "money", column = "l_money"),
            @Result(property = "time", column = "l_time"),
            @Result(property = "acc", column = "l_acc")
    })
    @Select("select * from t_log where l_acc = #{acc}")
    List<Object> selectByAcc(String acc);

    @Insert("insert into t_log (l_type,l_money,l_acc) values (#{type},#{money},#{acc})")
    int insertLog(Object log);
}
